###############################################
# ORDER OF THE SACRED MAGDALENE
# SACRED REGALIA COMMISSION DECISION
#
# File:
# decisions/ggsm_regalia_decisions.txt
###############################################

decisions = {

    ggsm_commission_sacred_regalia = {
        only_playable = yes
        is_high_prio = yes

        potential = {
            has_dlc = "Mystics"
            society_member_of = ggsm_order_sacred_magdalene
            is_adult = yes
            is_female = yes

            # Show the artisan decision only while at least one piece of
            # the CURRENT society-rank regalia set is still missing.
            OR = {
                AND = {
                    society_rank = {
                        society = ggsm_order_sacred_magdalene
                        rank == 1
                    }
                    OR = {
                        NOT = { has_artifact = ggsm_penitents_harness }
                        NOT = { has_artifact = ggsm_penitents_rod }
                        NOT = { has_artifact = ggsm_penitents_scourge }
                        NOT = { has_artifact = ggsm_ivory_wand }
                        NOT = { has_artifact = ggsm_rose_circlet }
                        NOT = { has_artifact = ggsm_leather_cuffs }
                        NOT = { has_artifact = ggsm_penitents_choker }
                        NOT = { has_artifact = ggsm_penitents_veil }
                        NOT = { has_artifact = ggsm_penitents_rings }
                    }
                }

                AND = {
                    society_rank = {
                        society = ggsm_order_sacred_magdalene
                        rank == 2
                    }
                    OR = {
                        NOT = { has_artifact = ggsm_harness_sacred_charity }
                        NOT = { has_artifact = ggsm_rod_sacred_charity }
                        NOT = { has_artifact = ggsm_scourge_confession }
                        NOT = { has_artifact = ggsm_scepter_charity }
                        NOT = { has_artifact = ggsm_silver_crown_magdalene }
                        NOT = { has_artifact = ggsm_silver_cuffs_mercy }
                        NOT = { has_artifact = ggsm_choker_sacred_charity }
                        NOT = { has_artifact = ggsm_veil_sacred_charity }
                        NOT = { has_artifact = ggsm_rings_sacred_charity }
                    }
                }

                AND = {
                    society_rank = {
                        society = ggsm_order_sacred_magdalene
                        rank == 3
                    }
                    OR = {
                        NOT = { has_artifact = ggsm_harness_open_mercy }
                        NOT = { has_artifact = ggsm_rod_open_mercy }
                        NOT = { has_artifact = ggsm_scourge_sacred_discipline }
                        NOT = { has_artifact = ggsm_scepter_carnal_charity }
                        NOT = { has_artifact = ggsm_crown_open_mercy }
                        NOT = { has_artifact = ggsm_bracelets_sacred_submission }
                        NOT = { has_artifact = ggsm_choker_open_mercy }
                        NOT = { has_artifact = ggsm_veil_open_mercy }
                        NOT = { has_artifact = ggsm_chains_open_mercy }
                    }
                }

                AND = {
                    society_rank = {
                        society = ggsm_order_sacred_magdalene
                        rank == 4
                    }
                    OR = {
                        NOT = { has_artifact = ggsm_courtesans_harness }
                        NOT = { has_artifact = ggsm_great_rod_magdalene }
                        NOT = { has_artifact = ggsm_magdalene_scourge }
                        NOT = { has_artifact = ggsm_scepter_courtesan }
                        NOT = { has_artifact = ggsm_crown_courtesan }
                        NOT = { has_artifact = ggsm_golden_bonds_magdalene }
                        NOT = { has_artifact = ggsm_courtesans_choker }
                        NOT = { has_artifact = ggsm_courtesans_veil }
                        NOT = { has_artifact = ggsm_jewels_courtesan }
                    }
                }
            }
        }

        allow = {
            is_inaccessible_trigger = no

            custom_tooltip = {
                text = ggsm_regalia_no_commission_in_progress_tt
                NOT = {
                    has_character_flag = ggsm_regalia_commission_in_progress
                }
            }
        }

        effect = {

            custom_tooltip = {
                text = ggsm_regalia_rank_quality_tt
            }

            custom_tooltip = {
                text = ggsm_regalia_cost_tt
            }

            custom_tooltip = {
                text = ggsm_regalia_guaranteed_tt
            }

            long_character_event = { id = ggsm.400 }
        }

		ai_will_do = {
            factor = 1
        }
    }
}
